import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/index.vue'
import Cart from '../views/Cart.vue'
import Order from '../views/Order.vue'
import Login from '../views/login.vue'
import Register from '../views/Register.vue'
import BookDetails from '../views/BookDetails.vue'
import BooksList from '../views/BooksList.vue'
import pay from '../views/pay.vue'
Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/index'
  },
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/login',
    name: 'Login',
    component:Login    
  },  
  {
    path:'/cart',
    name:'Cart',
    component:Cart
  },
  {
    path:'/order',
    name:'Order',
    component:Order
  },
  {
    path:'/register',
    name:'Register',
    component:Register
  },
  {
    path:'/bookDetails',
    name:'BookDetails',
    component:BookDetails
  },
  {
    path:'/pay',
    name:'pay',
    component:pay
  },
  {
    path:'/booksList/:category',
    name:'BooksList',
    component:BooksList
  }
]

const router = new VueRouter({
  routes
})

export default router
